import HttpClient from "@/utils/request.js";
import { CoinItem, Logo, KlineItem, QueryKline } from "@/interfaces/currency.js";
const http = new HttpClient({
    baseURL: 'https://new.uhx.io/hycurrency', // 代理地址
    timeout: 50000,
});

/**
 * 获取货币logo的函数
 * 该函数通过HTTP GET请求获取Logo数据
 * @returns 
 */
export const logo = () => {
    return http.get<Logo>('/currency/logo');
}


/**
 * 获取加密货币列表数据
 * @returns {Promise<CoinItem[]>} 
 */
export const getList1 = (): Promise<CoinItem[]> => {
    return http.get<CoinItem[]>('/market/getList');
}

/**
 * 获取k线历史数据
 * @returns {Promise<CoinItem[]>} 
 */
export const query = (params: QueryKline): Promise<KlineItem[]> => {
    return http.get<KlineItem[]>('/market/query', { params });
}


export const getFundingRate = (params: any): Promise<any> => {
    return http.get<any>('/market/getFundingRate', { params });
}

